home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 14 / CU Amiga Magazine's Super CD-ROM 14 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-09].iso / CUCD / Programming / IEditor / Examples / MultiSelect / MultiSelect_temp.c next >
Encoding:
C/C++ Source or Header  |  1997-06-17  |  1.8 KB  |  92 lines

  1. /*
  2.     C source code created by Interface Editor
  3.     Copyright © 1994-1996 by Simone Tellini
  4.  
  5.     Generator:  C.generator 37.15 (6.12.96)
  6.  
  7.     Copy registered to :  Simone Tellini
  8.     Serial Number      : #0
  9. */
  10.  
  11. /*
  12.    In this file you'll find empty  template  routines
  13.    referenced in the GUI source.  You  can fill these
  14.    routines with your code or use them as a reference
  15.    to create your main program.
  16. */
  17.  
  18. #include <stdio.h>
  19. #include <exec/types.h>
  20. #include <pragmas/exec_pragmas.h>
  21. #include <pragmas/gadtools_pragmas.h>
  22.  
  23. #include "MultiSelect.h"
  24.  
  25. extern void End( ULONG );
  26. extern struct Node ListNodes[];
  27. extern void  *WBMsg;
  28.  
  29. void Error(STRPTR str, STRPTR str2)
  30. {
  31.     TEXT c[ 256 ] = "";
  32.  
  33.     sprintf( c, "%s %s", str, str2 );
  34.  
  35.     if( WBMsg ) {   // this requires the 'Workbench' checkbox to be checked
  36.  
  37.     fprintf( stderr, "\n%s\n", c );
  38.  
  39.       } else {
  40.  
  41.     struct IntuiText error_text = {
  42.        0, 0, JAM1, 0, 10, NULL, c, NULL };
  43.  
  44.     static struct IntuiText ok_text = {
  45.        0, 0, JAM1, 0, 0, NULL, "OK", NULL };
  46.  
  47.     if( IntuitionBase )
  48.         AutoRequest( NULL, &error_text, NULL, &ok_text, 0, 0, 0, 0 );
  49.     }
  50.  
  51.     End( 10 );
  52. }
  53.  
  54.  
  55. BOOL MainCloseWindow( void )
  56. {
  57.     /*  Routine for IDCMP_CLOSEWINDOW  */
  58.     /*  Return FALSE to quit, I suppose... ;)  */
  59.     return( FALSE );
  60. }
  61.  
  62. BOOL QuitClicked( void )
  63. {
  64.     return( FALSE );
  65. }
  66.  
  67. BOOL QuitKeyPressed( void )
  68. {
  69.     return( FALSE );
  70. }
  71.  
  72.  
  73. BOOL ListClicked( void )
  74. {
  75.     static ULONG ListTag[] = { GTLV_Labels, 0, TAG_END };
  76.  
  77.     ListTag[1] = (ULONG)~0;
  78.  
  79.     GT_SetGadgetAttrsA( MainGadgets[ GD_List ], MainWnd, NULL,
  80.             ( struct TagItem * )ListTag );
  81.  
  82.     ListNodes[ MainMsg.Code ].ln_Pri ^= ML_SELECTED;
  83.  
  84.     ListTag[1] = (ULONG)&ListList;
  85.  
  86.     GT_SetGadgetAttrsA( MainGadgets[ GD_List ], MainWnd, NULL,
  87.             ( struct TagItem * )ListTag );
  88.  
  89.     return( TRUE );
  90. }
  91.  
  92.